<template>
	<view class="sticker-page">
		<view v-for="(v,i) in titles" :key="i">
			<sticker
				:scroll-top="scrollTop"
				:index="i"
				:style-top="top">
				<view class="title">{{v}}</view>
			</sticker>
			<view v-for="(o,j) in items" :key="j" class="item">{{o}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		created() {
			// #ifdef H5
			this.top = 44
			// #endif
		},
		data() {
			return{
				titles: ['逻辑层','视图层','自定义组件','插件'],
				items: ['注册程序', '场景值', '注册页面', '路由', '模块化', 'API', '路由', '模块化', 'API'],
				scrollTop: 0,
				top: 0
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop
		}
	}
</script>

<style lang="scss">
.title{
	padding:20upx 40upx;
	background: #eee;
}
.item{
	padding:30upx 40upx;
	border-top: solid 1upx #eee;
}
.sticker-page{
	position: relative;
}
</style>
